package edu.sctu.practice.class02.hujie.my_practice.day20151119collection;

/**
 * 课程类
 * Created by hp on 2015/11/19.
 */
public class Course {
    public String id;
    public String name;

    public Course(String id, String name) {
        this.id = id;
        this.name = name;
    }

    public Course() {

    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((name == null) ? 0 : name.hashCode());
        return result;
    }
    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (!(obj instanceof Course)) {
            return false;
        }
        Course course = (Course) obj;
        if (this.name == null) {
            if (course.name == null)
                return true;
            else
                return false;
        } else {
            if (this.name.equals(course.name))
                return true;
            else
                return false;
        }

    }
}
